<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">
    <title>暗黑模式切换开关</title>
  </head>
  <style>
	  .app{
	    width: 100%;
	    height: 100vh;
	    background-color: #ffffff;
	    position: relative;
	    display: flex;
	    justify-content: center;
	    align-items: center;
	  }
	  .label34{
	    width: 60px;
	    height: 32px;
	    position: relative;
	    cursor: pointer;
	  }
	  .inp34{
	    display: none;
	  }
	  .check-span34{
	    width: 100%;
	    height: 100%;
	    display: block;
	    background-color: #383838;
	    border: 2px solid #383838;
	    box-sizing: border-box;
	    border-radius: 16px;
	    transition: 0.3s linear;
	  }
	  .check-span34:after{
	    content: '';
	    width: 22px;
	    height: 22px;
	    background-color: #383838;
	    box-shadow: inset -8px -4px 0 #ffffff;
	    border-radius: 11px;
	    position: absolute;
	    top: 5px;
	    left: 6px;
	    box-sizing: border-box;
	    transition: 0.3s ease-in-out;
	  }
	  .inp34:checked + .check-span34{
	    background-color: #ffffff;
	  }
	  .inp34:checked + .check-span34:after{
	    transform: translateX(26px);
	    background-color: orange;
	    box-shadow: none;
	  }
  </style>
  <body>
    <div class="app">
      <label class="label34">
        <input class="inp34" type="checkbox">
        <span class="check-span34"></span>
      </label>
    </div>
  </body>
</html>